package com.dkd.day202511;

import com.dkd.day20250616.TreeNode;

public class Solution7 {
    //给你一棵二叉树的根节点 root ，翻转这棵二叉树，并返回其根节点。
    public static void main(String[] args) {

    }
    public TreeNode invertTree(TreeNode root) {
        if (root == null) return null;
        TreeNode right = root.right;
        root.right = invertTree(root.left);
        root.left = invertTree(right);
        return root;
    }
}
